home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / What's New? / Sample Code / Graphics 2D / New NewGWorld / Read Me < prev   
Encoding:
Text File  |  2000-09-28  |  3.1 KB  |  39 lines  |  [TEXT/ttxt]

  1. New NewGWorld 
  2. version 1.0.1
  3. 08/2000
  4. by GGS, updated by JM
  5. Worldwide Developer Relations
  6. <http://developer.apple.com/contact/feedback.html>, 
  7.  
  8. This sample is designed to show the proper use of the the new flags (Mac OS 9+ and the iBooks, slot loading iMacs and AGP Graphics G4 PowerMacs) in the NewGWorld routine.  The application draws a re-sizable window that is updated from an offscreen GWorld.  The user has control over where to allocate the GWorld's PixMap data (in VRAM, in AGP memory or in system memory).  A blitting test can then be performed to test blitting speed using CopyBits.
  9.  
  10. The application checks the offscreen in relationship to the window during execution to ensure that it is still viable.  The checks include looking for a NULL GWorld, a NULL PixMap, a NULL PixMap base address, non-matching window and GWorld GDevices, and non-matching window and GWorld color depths.  If any of these are true the GWorld is reallocated.  The user can see this reallocation with a color change in the window.  The application will also check the operating system (Mac OS 9.0 or later) and/or the boot ROM () at start for use of allocations in VRAM and AGP memory.  On older systems setting the new flags is ignored and the NewGWorld Pixmap data allocation will take place in system memory.
  11.  
  12. See Technote TN1182: "NewGWorlds in VRAM and AGP Memory" for further technical details about the new version of NewGWorld at: <http://developer.apple.com/technotes/tn/tn1182.html>
  13.  
  14. Building the Code
  15. This project was built and tested on CodeWarrior 2.1 using CarbonLib 1.1a3.  Since this is a Carbon app, the "Carbon Support" folder of the CarbonSDK should be in the same folder as the CodeWarrior IDE.  If this is not the case, the CarbonLib library will have to be re-added to the project.  In addition, the CarbonLib extension needs to be in the extension folder.  The CarbonSDK (which contains the library and the extension) can be found on Apple's website:  http://developer.apple.com/sdk/
  16.  
  17. Restrictions
  18. Nearly every sample requires more memory than the 384KB CodeWarrior sets as the default heap size.  If for some reason the memory has been reset to the default (either through converting the project or whatever) the memory should be reset to 1000 - 2000KB (depending on the application).  This can be achieved by going to the projects settings (Edit Menu->C-PPC Settings... under CodeWarrior 2.1) and selecting the "PPC Target" under the "Target" tab.
  19.  
  20. Other Code Notes
  21. This sample used to be a "non-Carbon" sample, but has been carbonized for demonstration purposes.  The "old" code has been left in (commented out) in order to compare and contrast the Carbon versus non-Carbon APIs.
  22.  
  23. Known Bugs
  24. No known bugs.
  25.  
  26. Possible Future Enhancements
  27. None at present.
  28.  
  29. Other Sources of Reference
  30. Additional sample code can be found at:
  31. http://developer.apple.com/samplecode/
  32. in addition, the Carbon API can be found at:
  33. http://developer.apple.com/techpubs/carbon/carbon.html
  34.  
  35. Version History
  36. 08/2000 - JM updated the source code to work with the Carbon API and changed the ReadMe file to mention those changes.  Additional notes are in the source code.
  37.  
  38. Author
  39. GS, JM - Apple Developer Technical Support - dts@apple.com